﻿namespace FATEFAKE
{
    #region using directives
    using System;
    using System.Diagnostics;
    #endregion

    class Program
    {
        static int Main(string[] args)
        {
            Options options = new Options(args);
            options.PrintOptions();
            if (!options.CheckOptions())
            {
                return 2;
            }

            TestRunner testRunner = new TestRunner(options);
            testRunner.InitializeCommands(options.FateFile);
            Stopwatch sw = Stopwatch.StartNew();
            bool b = testRunner.RunTests();
            sw.Stop();

            Console.WriteLine(string.Empty);
            Console.WriteLine(
                "Number of tests: {0}  FAILED={1} SUCCEEDED={2}",
                testRunner.CountTestsRan,
                testRunner.CountFailedTests,
                testRunner.CountSucceededTests);
            Console.WriteLine("Elasped time: {0} ms.", sw.ElapsedMilliseconds.ToString("N0"));

            return b == true ? 0 : 1;
        }
    }
}
